<?php
// +----------------------------------------------------------------------
// | EtrolPHP [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Author:LJQ <liujiqi@etrol.com>
// +-----------------------------------------------------------------------

namespace app\service\model;

use app\common\model\Base;
use app\common\model\User;
/**
 * 模型基类
 */
class Reliefcase extends Base{
	

	protected $name = 'documentlibrary';

	protected $createTime = 'createTime';
	protected $updateTime = 'updateTime';

	public $reliefcaseTypeList=[] ;
	protected $auto = ['typeId'];


	public function  settypeIdAttr(){
		return 5;
	}


	public  function getType(){

	 $reliefcaseType=db('basicinfo')->where(array('sysCode'=>19))->column('subsystemName','subsystemNo');
	 $this->reliefcaseTypeList=$reliefcaseType;
	 return $this->reliefcaseTypeList;
	}


	public function getlevelIdAttr($value,$data){
		$this->getType();
		if($data['levelId']){
			return $this->reliefcaseTypeList[$data['levelId']];
		}
		return null;
	}


	public function user(){

		return $this->hasOne(User::class,'id','operationId');

	}

}